home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / sndhrdw / cinemat.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  17KB  |  734 lines

  1. /***************************************************************************
  2.  
  3. Cinematronics sound handlers
  4.  
  5. Special thanks to Neil Bradley, Zonn Moore, and Jeff Mitchell of the
  6. Retrocade Alliance
  7.  
  8. Update:
  9. 6/27/99 Jim Hernandez -- 1st Attempt at Fixing Drone Star Castle sound and
  10.                          pitch adjustments.
  11. 6/30/99 MLR added Rip Off, Solar Quest, Armor Attack (no samples yet)
  12.  
  13. Bugs: Sometimes the death explosion (small explosion) does not trigger.
  14.  
  15.  
  16. ***************************************************************************/
  17.  
  18. #include "driver.h"
  19. #include "machine/z80fmly.h"
  20.  
  21.  
  22. static UINT32 current_shift = 0;
  23. static UINT32 last_shift = 0;
  24. static UINT32 last_shift16= 0;
  25. static UINT32 current_pitch = 0x20000;
  26. static UINT32 last_frame = 0;
  27.  
  28. static int cinemat_outputs = 0xff;
  29.  
  30.  
  31. typedef void (*cinemat_sound_handler_proc)(UINT8, UINT8);
  32.  
  33. static cinemat_sound_handler_proc cinemat_sound_handler;
  34.  
  35. READ_HANDLER( cinemat_output_port_r )
  36. {
  37.     return cinemat_outputs;
  38. }
  39.  
  40. WRITE_HANDLER( cinemat_output_port_w )
  41. {
  42.     if ((cinemat_outputs ^ data) & 0x9f)
  43.     {
  44.         if (cinemat_sound_handler)
  45.             cinemat_sound_handler (data & 0x9f, (cinemat_outputs ^ data) & 0x9f);
  46.     }
  47.  
  48.     cinemat_outputs = data;
  49. }
  50.  
  51.  
  52.  
  53. void cinemat_set_sound_handler(cinemat_sound_handler_proc sound_handler)
  54. {
  55.     cinemat_sound_handler = sound_handler;
  56.  
  57.     current_shift = 0xffff;
  58.     last_shift = 0xffff;
  59.     last_shift16 = 0xffff;
  60.     current_pitch = 0x20000;
  61.     last_frame = 0;
  62.  
  63. // Pitch the Drone sound will start off at
  64.  
  65. }
  66.  
  67. static void cinemat_shift (UINT8 sound_val, UINT8 bits_changed, UINT8 A1, UINT8 CLK)
  68. {
  69.     // See if we're latching a shift
  70.  
  71.     if ((bits_changed & CLK) && (0 == (sound_val & CLK)))
  72.     {
  73.         current_shift <<= 1;
  74.         if (sound_val & A1)
  75.             current_shift |= 1;
  76.     }
  77. }
  78.  
  79.  
  80. /***************************************************************************
  81.  
  82.   Star Castle
  83.  
  84. ***************************************************************************/
  85.  
  86. static const char *starcas_sample_names[] =
  87. {
  88.     "*starcas",
  89.     "lexplode.wav",
  90.     "sexplode.wav",
  91.     "cfire.wav",
  92.     "pfire.wav",
  93.     "drone.wav",
  94.     "shield.wav",
  95.     "star.wav",
  96.     "thrust.wav",
  97.     0    /* end of array */
  98. };
  99.  
  100. struct Samplesinterface starcas_samples_interface =
  101. {
  102.     8,    /* 8 channels */
  103.     25,    /* volume */
  104.     starcas_sample_names
  105. };
  106.  
  107. void starcas_sound_w(UINT8 sound_val, UINT8 bits_changed)
  108. {
  109.     UINT32 target_pitch;
  110.     UINT8 shift_diff;
  111.  
  112.     cinemat_shift (sound_val, bits_changed, 0x80, 0x10);
  113.  
  114.     // Now see if it's time to act upon the shifted data
  115.  
  116.     if ((bits_changed & 0x01) && (0 == (sound_val & 0x01)))
  117.     {
  118.         // Yep. Falling edge! Find out what has changed.
  119.  
  120.         shift_diff = current_shift ^ last_shift;
  121.  
  122.         if ((shift_diff & 1) && (0 == (current_shift & 1)))
  123.             sample_start(2, 2, 0);    // Castle fire
  124.  
  125.         if ((shift_diff & 2) && (0 == (current_shift & 2)))
  126.             sample_start(5, 5, 0);    // Shield hit
  127.  
  128.         if (shift_diff & 0x04)
  129.         {
  130.             if (current_shift & 0x04)
  131.                 sample_start(6, 6, 1);    // Star sound
  132.             else
  133.                 sample_stop(6);    // Stop it!
  134.         }
  135.  
  136.         if (shift_diff & 0x08)
  137.         {
  138.             if (current_shift & 0x08)
  139.                 sample_stop(7);    // Stop it!
  140.             else
  141.                 sample_start(7, 7, 1);    // Thrust sound
  142.         }
  143.  
  144.         if (shift_diff & 0x10)
  145.         {
  146.             if (current_shift & 0x10)
  147.                 sample_stop(4);
  148.             else
  149.                 sample_start(4, 4, 1);    // Drone
  150.         }
  151.  
  152.         // Latch the drone pitch
  153.  
  154.         target_pitch = (current_shift & 0x60) >> 3;
  155.         target_pitch |= ((current_shift & 0x40) >> 5);
  156.         target_pitch |= ((current_shift & 0x80) >> 7);
  157.  
  158.         // target_pitch = (current_shift & 0x60) >> 3;
  159.         // is the the target drone pitch to rise and stop at.
  160.  
  161.         target_pitch = 0x10000 + (target_pitch << 12);
  162.  
  163.         // 0x10000 is lowest value the pitch will drop to
  164.         // Star Castle drone sound
  165.  
  166.         if (cpu_getcurrentframe() > last_frame)
  167.         {
  168.             if (current_pitch > target_pitch)
  169.                 current_pitch -= 300;
  170.             if (current_pitch < target_pitch)
  171.                 current_pitch += 200;
  172.             sample_set_freq(4, current_pitch);
  173.             last_frame = cpu_getcurrentframe();
  174.         }
  175.  
  176.         last_shift = current_shift;
  177.     }
  178.  
  179.     if ((bits_changed & 0x08) && (0 == (sound_val & 0x08)))
  180.         sample_start(3, 3, 0);            // Player fire
  181.  
  182.     if ((bits_changed & 0x04) && (0 == (sound_val & 0x04)))
  183.         sample_start(1, 1, 0);            // Soft explosion
  184.  
  185.     if ((bits_changed & 0x02) && (0 == (sound_val & 0x02)))
  186.         sample_start(0, 0, 0);            // Loud explosion
  187.  
  188. }
  189.  
  190.  
  191. /***************************************************************************
  192.  
  193.   Warrior
  194.  
  195. ***************************************************************************/
  196.  
  197. static const char *warrior_sample_names[] =
  198. {
  199.     "*warrior",
  200.     "appear.wav",
  201.     "bgmhum1.wav",
  202.     "bgmhum2.wav",
  203.     "fall.wav",
  204.     "killed.wav",
  205.     0    /* end of array */
  206. };
  207.  
  208. struct Samplesinterface warrior_samples_interface =
  209. {
  210.     5,    /* 8 channels */
  211.     25,    /* volume */
  212.     warrior_sample_names
  213. };
  214.  
  215. void warrior_sound_w(UINT8 sound_val, UINT8 bits_changed)
  216. {
  217.  
  218.     if ((bits_changed & 0x10) && (0 == (sound_val & 0x10)))
  219.     {
  220.         sample_start(0, 0, 0);            // appear
  221.     }
  222.  
  223.     if ((bits_changed & 0x08) && (0 == (sound_val & 0x08)))
  224.         sample_start(3, 3, 0);            // fall
  225.  
  226.     if ((bits_changed & 0x04) && (0 == (sound_val & 0x04)))
  227.         sample_start(4, 4, 0);            // explosion (kill)
  228.  
  229.     if (bits_changed & 0x02)
  230.     {
  231.         if ((sound_val & 0x02) == 0)
  232.             sample_start(2, 2, 1);            // hi level
  233.         else
  234.             sample_stop(2);
  235.     }
  236.  
  237.     if (bits_changed & 0x01)
  238.     {
  239.         if ((sound_val & 0x01) == 0)
  240.             sample_start(1, 1, 1);            // normal level
  241.         else
  242.             sample_stop(1);
  243.     }
  244. }
  245.  
  246.  
  247. /***************************************************************************
  248.  
  249.   Armor Attack
  250.  
  251. ***************************************************************************/
  252.  
  253. void armora_sound_w(UINT8 sound_val, UINT8 bits_changed)
  254. {
  255.     UINT8 shift_diff;
  256.  
  257.     cinemat_shift (sound_val, bits_changed, 0x80, 0x10);
  258.  
  259.     // Now see if it's time to act upon the shifted data
  260.  
  261.     if ((bits_changed & 0x01) && (0 == (sound_val & 0x01)))
  262.     {
  263.         // Yep. Falling edge! Find out what has changed.
  264.  
  265.         shift_diff = current_shift ^ last_shift;
  266.  
  267.         if ((shift_diff & 1) && (0 == (current_shift & 1)))
  268.             sample_start(0, 0, 0);    // Tank fire
  269.  
  270.         if ((shift_diff & 2) && (0 == (current_shift & 2)))
  271.             sample_start(1, 1, 0);    // Hi explosion
  272.  
  273.         if ((shift_diff & 4) && (0 == (current_shift & 4)))
  274.             sample_start(2, 2, 0);    // Jeep fire
  275.  
  276.         if ((shift_diff & 8) && (0 == (current_shift & 8)))
  277.             sample_start(3, 3, 0);    // Lo explosion
  278.  
  279.         /* High nibble unknown */
  280.         last_shift = current_shift;
  281.     }
  282.  
  283.     if (bits_changed & 0x2)
  284.     {
  285.         if (sound_val & 0x2)
  286.             sample_start(4, 4, 1);    // Tank +
  287.         else
  288.             sample_stop(4);
  289.     }
  290.     if (bits_changed & 0x4)
  291.     {
  292.         if (sound_val & 0x4)
  293.             sample_start(5, 5, 1);    // Beep +
  294.         else
  295.             sample_stop(5);
  296.     }
  297.     if (bits_changed & 0x8)
  298.     {
  299.         if (sound_val & 0x8)
  300.             sample_start(6, 6, 1);    // Chopper +
  301.         else
  302.             sample_stop(6);
  303.     }
  304. }
  305.  
  306.  
  307. /***************************************************************************
  308.  
  309.   Ripoff
  310.  
  311. ***************************************************************************/
  312.  
  313. static const char *ripoff_sample_names[] =
  314. {
  315.     "*ripoff",
  316.     "efire.wav",
  317.     "eattack.wav",
  318.     "bonuslvl.wav",
  319.     "explosn.wav",
  320.     "shipfire.wav",
  321.     "bg1.wav",
  322.     "bg2.wav",
  323.     "bg3.wav",
  324.     "bg4.wav",
  325.     "bg5.wav",
  326.     "bg6.wav",
  327.     "bg7.wav",
  328.     "bg8.wav",
  329.     0    /* end of array */
  330. };
  331.  
  332. struct Samplesinterface ripoff_samples_interface =
  333. {
  334.     8,    /* 8 channels */
  335.     25,    /* volume */
  336.     ripoff_sample_names
  337. };
  338.  
  339. void ripoff_sound_w(UINT8 sound_val, UINT8 bits_changed)
  340. {
  341.     UINT8 shift_diff, current_bg_sound;
  342.     static UINT8 last_bg_sound;
  343.  
  344.     cinemat_shift (sound_val, bits_changed, 0x01, 0x02);
  345.  
  346.     // Now see if it's time to act upon the shifted data
  347.  
  348.     if ((bits_changed & 0x04) && (0 == (sound_val & 0x04)))
  349.     {
  350.         // Yep. Falling edge! Find out what has changed.
  351.  
  352.         shift_diff = current_shift ^ last_shift;
  353.  
  354.         current_bg_sound = ((current_shift & 0x1) << 2) | (current_shift & 0x2) | ((current_shift & 0x4) >> 2);
  355.         if (current_bg_sound != last_bg_sound) // use another background sound ?
  356.         {
  357.             shift_diff |= 0x08;
  358.             sample_stop(4);
  359.             last_bg_sound = current_bg_sound;
  360.         }
  361.  
  362.         if (shift_diff & 0x08)
  363.         {
  364.             if (current_shift & 0x08)
  365.                 sample_stop(5);
  366.             else
  367.                 sample_start(5, 5+last_bg_sound, 1);    // Background
  368.         }
  369.  
  370.         if ((shift_diff & 0x10) && (0 == (current_shift & 0x10)))
  371.             sample_start(2, 2, 0);    // Beep
  372.  
  373.         if (shift_diff & 0x20)
  374.         {
  375.             if (current_shift & 0x20)
  376.                 sample_stop(1);    // Stop it!
  377.             else
  378.                 sample_start(1, 1, 1);    // Motor
  379.         }
  380.  
  381.         last_shift = current_shift;
  382.     }
  383.  
  384.     if ((bits_changed & 0x08) && (0 == (sound_val & 0x08)))
  385.         sample_start(4, 4, 0);            // Torpedo
  386.  
  387.     if ((bits_changed & 0x10) && (0 == (sound_val & 0x10)))
  388.         sample_start(0, 0, 0);            // Laser
  389.  
  390.     if ((bits_changed & 0x80) && (0 == (sound_val & 0x80)))
  391.         sample_start(3, 3, 0);            // Explosion
  392.  
  393. }
  394.  
  395.  
  396. /***************************************************************************
  397.  
  398.   Solar Quest
  399.  
  400. ***************************************************************************/
  401.  
  402. static const char *solarq_sample_names[] =
  403. {
  404.     "*solarq",
  405.     "bigexpl.wav",
  406.     "smexpl.wav",
  407.     "lthrust.wav",
  408.     "slaser.wav",
  409.     "pickup.wav",
  410.     "nuke1.wav",
  411.     "nuke2.wav",
  412.     "hypersp.wav",
  413.     "extra.wav",
  414.     "phase.wav",
  415.     "efire.wav",
  416.     0    /* end of array */
  417. };
  418.  
  419. struct Samplesinterface solarq_samples_interface =
  420. {
  421.     8,    /* 8 channels */
  422.     25,    /* volume */
  423.     solarq_sample_names
  424. };
  425.  
  426.  
  427. void solarq_sound_w(UINT8 sound_val, UINT8 bits_changed)
  428. {
  429.     UINT32 shift_diff, shift_diff16;
  430.     static int target_volume, current_volume;
  431.  
  432.     cinemat_shift (sound_val, bits_changed, 0x80, 0x10);
  433.  
  434.     if ((bits_changed & 0x01) && (0 == (sound_val & 0x01)))
  435.     {
  436.         shift_diff16 = current_shift ^ last_shift16;
  437.  
  438.         if ((shift_diff16 & 0x1) && (current_shift & 0x1))
  439.         {
  440.             switch (current_shift & 0xffff)
  441.             {
  442.             case 0xceb3:
  443.                 sample_start(7, 7, 0);    // Hyperspace
  444.                 break;
  445.             case 0x13f3:
  446.                 sample_start(7, 8, 0);    // Extra
  447.                 break;
  448.             case 0xfdf3:
  449.                 sample_start(7, 9, 0);    // Phase
  450.                 break;
  451.             case 0x7bf3:
  452.                 sample_start(7, 10, 0);    // Enemy fire
  453.                 break;
  454.             default:
  455.                 logerror("Unknown sound starting with: %x\n", current_shift & 0xffff);
  456.                 break;
  457.             }
  458.         }
  459.  
  460.         last_shift16 = current_shift;
  461.     }
  462.  
  463.     // Now see if it's time to act upon the shifted data
  464.  
  465.     if ((bits_changed & 0x02) && (0 == (sound_val & 0x02)))
  466.     {
  467.         // Yep. Falling edge! Find out what has changed.
  468.  
  469.         shift_diff = current_shift ^ last_shift;
  470.  
  471.         if ((shift_diff & 0x01) && (0 == (current_shift & 0x01)))
  472.             sample_start(0, 0, 0);    // loud expl.
  473.  
  474.         if ((shift_diff & 0x02) && (0 == (current_shift & 0x02)))
  475.             sample_start(1, 1, 0);    // soft expl.
  476.  
  477.         if (shift_diff & 0x04) // thrust
  478.         {
  479.             if (current_shift & 0x04)
  480.                 target_volume = 0;
  481.             else
  482.             {
  483.                 target_volume = 255;
  484.                 current_volume = 0;
  485.                 sample_start(2, 2, 1);
  486.             }
  487.         }
  488.  
  489.         if (sample_playing(2) && (last_frame < cpu_getcurrentframe()))
  490.         {
  491.             if (current_volume > target_volume)
  492.                 current_volume -= 20;
  493.             if (current_volume < target_volume)
  494.                 current_volume += 20;
  495.             if (current_volume > 0)
  496.                 sample_set_volume(2, current_volume);
  497.             else
  498.                 sample_stop(2);
  499.             last_frame = cpu_getcurrentframe();
  500.         }
  501.  
  502.         if ((shift_diff & 0x08) && (0 == (current_shift & 0x08)))
  503.             sample_start(3, 3, 0);    // Fire
  504.  
  505.         if ((shift_diff & 0x10) && (0 == (current_shift & 0x10)))
  506.             sample_start(4, 4, 0);    // Capture
  507.  
  508.         if (shift_diff & 0x20)
  509.         {
  510.             if (current_shift & 0x20)
  511.                 sample_start(6, 6, 1);    // Nuke +
  512.             else
  513.                 sample_stop(6);
  514.         }
  515.  
  516.         if ((shift_diff & 0x40) && (0 == (current_shift & 0x40)))
  517.             sample_start(5, 5, 0);    // Photon
  518.  
  519.         last_shift = current_shift;
  520.     }
  521. }
  522.  
  523.  
  524. /***************************************************************************
  525.  
  526.   Spacewar
  527.  
  528. ***************************************************************************/
  529.  
  530. static const char *spacewar_sample_names[] =
  531. {
  532.     "*spacewar",
  533.     "explode1.wav",
  534.     "fire1.wav",
  535.     "idle.wav",
  536.     "thrust1.wav",
  537.     "thrust2.wav",
  538.     "pop.wav",
  539.     "explode2.wav",
  540.     "fire2.wav",
  541.     0    /* end of array */
  542. };
  543.  
  544. struct Samplesinterface spacewar_samples_interface =
  545. {
  546.     8,    /* 8 channels */
  547.     25,    /* volume */
  548.     spacewar_sample_names
  549. };
  550.  
  551. void spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed)
  552. {
  553.  
  554.     // Explosion
  555.  
  556.     if (bits_changed & 0x01)
  557.     {
  558.         if (sound_val & 0x01)
  559.         {
  560.             if (rand() & 1)
  561.                 sample_start(0, 0, 0);
  562.             else
  563.                 sample_start(0, 6, 0);
  564.         }
  565.     }
  566.     // Fire sound
  567.  
  568.     if ((sound_val & 0x02) && (bits_changed & 0x02))
  569.     {
  570.             if (rand() & 1)
  571.                 sample_start(1, 1, 0);
  572.             else
  573.                 sample_start(1, 7, 0);
  574.     }
  575.  
  576.     // Player 1 thrust
  577.  
  578.     if (bits_changed & 0x04)
  579.     {
  580.         if (sound_val & 0x04)
  581.             sample_stop(3);
  582.         else
  583.             sample_start(3, 3, 1);
  584.     }
  585.  
  586.     // Player 2 thrust
  587.  
  588.     if (bits_changed & 0x08)
  589.     {
  590.         if (sound_val & 0x08)
  591.             sample_stop(4);
  592.         else
  593.             sample_start(4, 4, 1);
  594.     }
  595.  
  596.     // Sound board shutoff (or enable)
  597.  
  598.     if (bits_changed & 0x10)
  599.     {
  600.         // This is a toggle bit. If sound is enabled, shut everything off.
  601.  
  602.         if (sound_val & 0x10)
  603.         {
  604.             int i;
  605.  
  606.             for (i = 0; i < 5; i++)
  607.             {
  608.                 if (i != 2)
  609.                     sample_stop(i);
  610.             }
  611.  
  612.             sample_start(2, 5, 0);    // Pop when board is shut off
  613.         }
  614.         else
  615.             sample_start(2, 2, 1);    // Otherwise play idle sound
  616.     }
  617. }
  618.  
  619.  
  620. /***************************************************************************
  621.  
  622.   Demon
  623.  
  624. ***************************************************************************/
  625.  
  626.  
  627. /* circular queue with read and write pointers */
  628. #define QUEUE_ENTRY_COUNT  10
  629. static int sound_latch_rp = 0;
  630. static int sound_latch_wp = 0;
  631. static int sound_latch[QUEUE_ENTRY_COUNT];
  632.  
  633. void demon_sound_w(UINT8 sound_val, UINT8 bits_changed)
  634. {
  635.     int pc = cpu_get_pc();
  636.  
  637.     if (pc == 0x0fbc ||
  638.         pc == 0x1fed ||
  639.         pc == 0x2ff1 ||
  640.         pc == 0x3fd3)
  641.     {
  642.         sound_latch[sound_latch_wp] = ((sound_val & 0x07) << 3);
  643.     }
  644.     if (pc == 0x0fc8 ||
  645.         pc == 0x1ff9 ||
  646.         pc == 0x2ffd ||
  647.         pc == 0x3fdf)
  648.     {
  649.         sound_latch[sound_latch_wp] |= (sound_val & 0x07);
  650.  
  651.         //logerror("Writing Sound Latch %04X = %02X\n", pc, sound_latch[sound_latch_wp]);
  652.  
  653.         sound_latch_wp++;
  654.         if (sound_latch_wp == QUEUE_ENTRY_COUNT)  sound_latch_wp = 0;
  655.     }
  656. }
  657.  
  658. static READ_HANDLER(demon_sound_r)
  659. {
  660.     int ret;
  661.  
  662.     if (sound_latch_rp == sound_latch_wp)    return 0x80;    /* no data in queue */
  663.  
  664.     ret = sound_latch[sound_latch_rp];
  665.  
  666.     sound_latch_rp++;
  667.     if (sound_latch_rp == QUEUE_ENTRY_COUNT)  sound_latch_rp = 0;
  668.  
  669.     //logerror("Reading Sound Latch %04X = %02X\n", cpu_get_pc(), ret);
  670.  
  671.     return ret;
  672. }
  673.  
  674.  
  675. struct AY8910interface demon_ay8910_interface =
  676. {
  677.     3,    /* 3 chips */
  678.     3579545,    /* 3.579545 Mhz */
  679.     { 25, 25, 25 },
  680.     { demon_sound_r },
  681.     { 0 },    /* there are sound enable bits in here, but don't know what is what */
  682.     { 0 },
  683.     { 0 }
  684. };
  685.  
  686.  
  687. static void ctc_interrupt (int state)
  688. {
  689.     cpu_cause_interrupt (1, Z80_VECTOR(0,state) );
  690. }
  691.  
  692. z80ctc_interface demon_z80ctc_interface =
  693. {
  694.     1,                   /* 1 chip */
  695.     { 0 },               /* clock (filled in from the CPU clock) */
  696.     { 0 },               /* timer disables */
  697.     { ctc_interrupt },   /* interrupt handler */
  698.     { 0 },               /* ZC/TO0 callback */
  699.     { 0 },               /* ZC/TO1 callback */
  700.     { 0 }                /* ZC/TO2 callback */
  701. };
  702.  
  703.  
  704. struct MemoryReadAddress demon_sound_readmem[] =
  705. {
  706.     { 0x0000, 0x0fff, MRA_ROM },
  707.     { 0x3000, 0x33ff, MRA_RAM },
  708.     { 0x4001, 0x4001, AY8910_read_port_0_r },
  709.     { 0x5001, 0x5001, AY8910_read_port_1_r },
  710.     { 0x6001, 0x6001, AY8910_read_port_2_r },
  711.     { -1 }  /* end of table */
  712. };
  713.  
  714. struct  MemoryWriteAddress demon_sound_writemem[] =
  715. {
  716.     { 0x0000, 0x0fff, MWA_ROM },
  717.     { 0x3000, 0x33ff, MWA_RAM },
  718.     { 0x4002, 0x4002, AY8910_write_port_0_w },
  719.     { 0x4003, 0x4003, AY8910_control_port_0_w },
  720.     { 0x5002, 0x5002, AY8910_write_port_1_w },
  721.     { 0x5003, 0x5003, AY8910_control_port_1_w },
  722.     { 0x6002, 0x6002, AY8910_write_port_2_w },
  723.     { 0x6003, 0x6003, AY8910_control_port_2_w },
  724.     { 0x7000, 0x7000, MWA_NOP },  /* watchdog? */
  725.     { -1 }  /* end of table */
  726. };
  727.  
  728. struct IOWritePort demon_sound_writeport[] =
  729. {
  730.     { 0x00, 0x03, z80ctc_0_w },
  731.     { 0x1c, 0x1f, z80ctc_0_w },
  732.     { -1 }    /* end of table */
  733. };
  734.